<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/14
 * Time: 10:35
 */

include_once '../tools/common.php';
include_once '../tools/DbTools.php';
session_start();
$is_login = getLoginStatus();
if(!$is_login){
    echo '尚未登陆，<a href="loginUi.php">请先登录</a>';
    die;
}else{
    $userinfo = $_SESSION[$_COOKIE['Token']];
    $realName = $userinfo['RealName'];
    $CardNo = $userinfo['CardNo'];
    DbTools::InitDb();
    $sql = "select CardMoney from bankcard where CardId=".$userinfo['CardId'];
    $result = DbTools::select($sql);
    DbTools::close();
    $money = $result[0]['CardMoney'];
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户中心</title>
</head>
<body>
<h3>欢迎您，<?php echo $realName;?>&nbsp<a href="logoutAction.php">退出</a></h3>
<p>卡号：<?php echo $CardNo; ?>&nbsp&nbsp￥:<?php echo $money; ?></p>
<ul>
    <li><a href="../money/moneyIn.php">存钱</a></li>
    <li><a href="../money/moneyOut.php">取钱</a></li>
    <li><a href="../money/transfer.php">转账</a></li>
    <li><a href="../accountOption/anotherCards.php">查询用户银行卡</a></li>
</ul>
</body>
</html>
